<template>
  <div class="dashboard-container">
    <!-- 头部部分 -->
    <el-card class="header-card">
      <div class="header">
        <div class="headerImg">
          <img
            v-imageError="require('@/assets/common/233.jpg')"
            :src="avatar"
            alt=""
            class="avatar"
          >
        </div>
        <div>
          <div class="text">
            <p class="text-contain">
              {{ name }} 你好！欢迎来到后台管理系统
            </p>
            <p class="textnd">
              v me fifty, treat me to crazy Thursday
            </p>
          </div>

        </div>
      </div>

    </el-card>
    <!-- 主要内容 -->
    <el-row type="flex" justify="space-between">
      <!-- 左侧内容 -->
      <el-col :span="13" style="padding-right: 26px">
        <!-- 工作日历 -->
        <el-card class="box-card">
          <div slot="header" class="header">
            <span class="titlestyle">工作日历</span>
          </div>
          <!-- 放置日历组件 -->
          <WorkCalendar />
        </el-card>
        <!-- 公告 -->
        <el-card class="box-card">
          <div class="advContent">
            <div class="title titlestyle">公告</div>
            <div class="contentItem">
              <ul class="noticeList">
                <li>
                  <div class="item">

                    <div>
                      <p>
                        <span class="col">王涛</span> 发布了
                        优秀员工获奖名单公布
                      </p>
                      <p>2022-09-04 08:54:38</p>
                    </div>
                  </div>
                </li>
                <li>
                  <div class="item">

                    <div>
                      <p>
                        <span class="col">王涛</span> 发布了
                        八月绩效及奖金公布
                      </p>
                      <p>2022-09-02 09:37:45</p>
                    </div>
                  </div>
                </li>
                <li>
                  <div class="item">
                    <div>
                      <p>
                        <span class="col">王涛</span> 发布了
                        八月考勤统计情况
                      </p>
                      <p>2022-09-02 08:21:32</p>
                    </div>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </el-card>
      </el-col>
      <!-- 右侧内容 -->
      <el-col :span="11">
        <el-card class="box-card">
          <div class="header headTit">
            <span class="titlestyle">流程申请</span>
          </div>
          <div class="sideNav">
            <el-button class="sideBtn">加班离职</el-button>
            <el-button class="sideBtn">请假调休</el-button>
            <el-button class="sideBtn">审批列表</el-button>
            <el-button class="sideBtn">我的信息</el-button>
          </div>
        </el-card>

        <!-- 绩效指数 -->
        <el-card class="box-card">
          <div slot="header" class="header">
            <span class="titlestyle">绩效指数</span>
          </div>
          <!-- 放置雷达图 -->
          <Radar class="radar" />
        </el-card>
        <!-- 帮助连接 -->
        <el-card class="box-card">
          <div class="header headTit">
            <span class="titlestyle">帮助链接</span>
          </div>
          <div class="sideLink">
            <el-row>
              <el-col :span="8">
                <a href="#">
                  <span class="icon iconGuide" />
                  <p>入门指南</p>
                </a>
              </el-col>
              <el-col :span="8">
                <a href="#">
                  <span class="icon iconHelp" />
                  <p>在线帮助手册</p>
                </a>
              </el-col>
              <el-col :span="8">
                <a href="#">
                  <span class="icon iconTechnology" />
                  <p>联系技术支持</p>
                </a>
              </el-col>
            </el-row>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import WorkCalendar from './component/work-calendar.vue'
import Radar from './component/radar.vue'

export default {
  name: 'Dashboard',
  components: { WorkCalendar, Radar },
  computed: {
    ...mapGetters([
      'name',
      'avatar'
    ])
  },
  async created() {
    // await this.$store.dispatch('user/getUserMessage')
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
.sideNav{
  margin-top: 20px;
}

.titlestyle{
  font-weight: 700;
  font-size: 25px;
  display: inline-block;
  border-bottom: solid 5px skyblue;
}
.header-card{
  height: 200px;
  .header{
    display: flex;

    .avatar{
      width: 150px;
      height: 150px;
      border-radius: 50%;
    }
    .text{
      margin-left: 50px;
      .text-contain{
      font-size: 30px;
      font-weight: 700;
    }
    .textnd{

  color: gray;
  font-size: 20px;
}
    }

  }

}
</style>
